package com.lhwl.it.util;

import java.util.Map;

public  class DataUtil {
	
	public static int getInt(String key,Map map) {
		Object value=map.get(key);
		try {
			return Integer.parseInt(value.toString());
		} catch (Exception e) {
			return 0;
		}
	}

	public static int getInt(String key,Map map,int defv) {
		Object value=map.get(key);
		try {
			return Integer.parseInt(value.toString());
		} catch (Exception e) {
			return defv;
		}
	}
	
	public static String trim(Object  obj) {
		if (obj !=null ) {
			String temps=obj.toString();
			return temps.trim();
		}
		return "";
	}
	
}
